<template>
	<view class="index">

		<u-swiper :list="list2" height="400rpx" keyName="image" showTitle :autoplay="false" previousMargin="40"
			nextMargin="40" radius="10rpx" circular></u-swiper>

		<view class="service_wrapper">

			<view class="typeView">服务专区</view>

			<view class="service">
				<view v-for="(item,index) in serviceArr" class="child1" @click="toDetail(index)">
					<view class="child1Left">
						<view class="title1">{{item.title}}</view>
						<view class="title2">{{item.content}}</view>
					</view>					
					<image class="highGoods2Img" mode="widthFix" :src="`/static/images/highGoods${item.type}.png`"></image>
					
				</view>
			</view>

		</view>

		<view style="height: 60rpx;"></view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				chartData: {},
				list2: [{
						image: "https://file.huaxinjiafu.com/uploadfile/20250107/735191399527555073.jpg",
						title: "展示景县免费政务服务电话6012345",
					},
					{
						image: "https://file.huaxinjiafu.com/uploadfile/20250121/740170587120705536.jpg",
						title: "社区服务电话6012345",
					},
					{
						image: "https://file.huaxinjiafu.com/uploadfile/20250109/735779074924064768.jpg",
						title: "小区的负责人姓名、职责和电话1, 小区的负责人姓名、职责和电话2，小区的负责人姓名、职责和电话3",
					},
				],
				serviceArr: [{
						title: '功能室',
						content: '介绍1',
						type: '1'
					},
					{
						title: '公益大讲堂',
						content: '介绍2',
						type: '2'
					},
					{
						title: '社区服务',
						content: '介绍3',
						type: '1'
					},
					{
						title: '物业服务',
						content: '介绍4',
						type: '2'
					},
					{
						title: '其它服务',
						content: '介绍5',
						type: '1'
					},
				]

			}
		},
		onLoad() {

			let _this = this

			
			uni.login({
				success(res){
					console.log(res.code)
					_this.mpLogin(res.code)
					
					// wxLogin(res.code).then((res)=>{
					// 	if(res.user_info){
					// 		userInfo.value=res.user_info
					// 	}
					// })
				}
			})
		},
		onReady: function(res) {
			
		},
		methods: {
			mpLogin(code){
				let params = {
					code
				}
				this.$http.get(this.$api.mpLogin, params).then(res=>{
					console.log(res)
					
				})
			},
			toDetail(index){
				// uni.navigateTo({
				// 	url: '/pages/my/auth'
				// })
				
				if(index==0){
					uni.navigateTo({
						url: '/pages/function/list'
					})
				}

			},
			
			
		}
	}
</script>

<style lang="scss" scoped>
	.index {
		/* background-color: black;
		min-height: 100vh; */
	}

	/deep/ .u-line-1 {
		line-clamp: 999 !important;
		-webkit-line-clamp: 999 !important;
	}

	.service_wrapper {
		margin: 0rpx 40rpx;

		.typeView {
			margin-top: 40rpx;
			font-size: 36rpx;
			font-weight: bold;
		}
	}

	.service {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		flex-wrap: wrap;

		.child1 {
			margin-top: 30rpx;
			width: 40%;
			padding: 0rpx 20rpx;
			// margin-right: 40rpx;
			// flex: 1;
			height: 160rpx;
			border-radius: 10rpx;
			background-color: #ffedec;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.child1Left {
				.title1 {
					color: #333333;
					font-size: 28rpx;
					font-family: PingFangSC-Semibold;
				}

				.title2 {
					color: #666666;
					font-size: 22rpx;
					font-family: PingFangSC-Regular;
					padding-top: 16rpx;
				}
			}

			.highGoods2Img {
				width: 90rpx;
				margin-right: 0rpx;
			}
		}

		.child2 {
			padding: 0rpx 20rpx;
			flex: 1;
			height: 160rpx;
			border-radius: 10rpx;
			background-color: #edf3ff;
			display: flex;
			align-items: center;
			justify-content: space-between;

			.child2Left {
				.title1 {
					color: #333333;
					font-size: 28rpx;
					font-family: PingFangSC-Semibold;
				}

				.title2 {
					color: #666666;
					font-size: 20rpx;
					font-family: PingFangSC-Regular;
					padding-top: 16rpx;
				}
			}

			.highGoods3Img {
				width: 87rpx;
				margin-right: 0rpx;
			}
		}
	}

	.charts-box {
		width: 100%;
		height: 300px;
	}
</style>